<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@taglib uri="/WEB-INF/tld/pageutil.tld" prefix="pu"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<%@taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt-rt"%>
<%@taglib uri="/WEB-INF/tld/pageable.tld" prefix="pageable"%>
<%@page import="com.yaodian100.core.common.utils.ServerValue"%>
<c-rt:set var="hostName" value='<%=ServerValue.getFrontHostname()%>'/>
<c-rt:set var="frontendContextPath"><%=ServerValue.getFrontContextPath()%></c-rt:set>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 
<%@page import="org.apache.commons.lang.time.DateUtils"%>
<%@page import="java.util.Date"%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style>
.promo-popup{padding:10px;*padding:10px 0 10px 8px; color:#666;line-height:1.4em; }
.promo-popup h2,.promo-popup h3{font-size:15px;color:#d12e6f; margin-bottom:.8em;}
.promo-popup h3{color:#666;}
.promo-popup p{margin:.5em 0;}
.promo-popup .d-line{background:url(/images/link_dote.gif) repeat-x scroll 0 50%; padding:1px 0;}
.promo-popup ol,.promo-popup ul{margin-bottom:1em;margin-left:2em;}
.promo-popup li{list-style:decimal;}
</style>
<s:url var="link" value="/member/myOrder/showOrders.do"/>
<script language="javascript">
	$().ready(function(){
		if ( "" == "${selectParam}" )
			$("#selectParam").val("请输入商品名称/商品编号/订单编号").attr("class","txt-gy");
		
		$("#selectParam").focus(function(){
			if($("#selectParam").val()=='请输入商品名称/商品编号/订单编号')
				$("#selectParam").val("").removeClass("txt-gy");
		}).blur(function(){
			if($("#selectParam").val()=='')
				$("#selectParam").val("请输入商品名称/商品编号/订单编号").attr("class","txt-gy");
		});
		<c:if test="${htmlContent.orderType =='H'}">
			$("#current_location").html('&nbsp;&gt;&nbsp;我的订单&nbsp;-&nbsp;全部订单');
			$("#m_historyOrders").css("font-weight","bold");
		</c:if>
		<c:if test="${htmlContent.orderType == 'T' || htmlContent.orderType == 'Y'}">
			$("#current_location").html('&nbsp;&gt;&nbsp;我的订单&nbsp;-&nbsp;近三个月订单');
			$("#m_recentOrders").css("font-weight","bold");
		</c:if>
		<c:if test="${htmlContent.orderType == 'GH'||htmlContent.orderType == 'GT'||htmlContent.orderType == 'GY'}">
			$("#current_location").html('&nbsp;&gt;&nbsp;我的订单&nbsp;-&nbsp;我的团购');
			$("#m_recentOrders").css("font-weight","bold");
		</c:if>
		<c:if test="${htmlContent.orderType == 'OP'}">
		$("#current_location").html('&nbsp;&gt;&nbsp;抽奖活动');
		$("#m_recentOrders").css("font-weight","bold");
		</c:if>
		$(":a[id*=open_]").click(function(){
			var id = $(this).attr('id').split('_')[1];
			$("#open_"+id).hide();
			
			$("#close_"+id).show();
			$("#org_"+id).attr("class","od-separate-main");
			var trs = $(":tr[id*=split_"+id+"]");
			jQuery(trs.eq(trs.length-1)).find("td").each(function(){
				if(!$(this).attr('class').match(/base/)){
					$(this).attr('class',$(this).attr('class')+' base');
				}
			});
			trs.show();
		});
		$("#select").click(function(){
			if($("#selectParam").val()!='请输入商品名称/商品编号/订单编号'){
				window.location.replace("${link}?t=HSP&p=1&s="+$("#selectParam").val());
								
			}else{
				alert("请输入查询条件");
			}
			
		});
		$(":a[id*=close_]").click(function(){
			var id = $(this).attr('id').split('_')[1];
			$("#open_"+id).show();
			$("#org_empty_op_"+id).hide();
			$("#org_op_"+id).show();
			$("#close_"+id).hide();
			$("#org_"+id).removeAttr("class");
			$(":tr[id*=split_"+id+"]").hide();
		});
	});
	
	
	function openChgOrder(val,ord,allowSplit){
		var selectItem = '';
		if(val == '1'){
			selectItem = '	<li class="w-1of1"><label><input type="radio" value="PaymentTp" name="ChgOrdTp" disabled> 修改支付方式</label></li>'+
			'	<li class="w-1of1"><label><input type="radio" value="RecvInfo" name="ChgOrdTp" checked> 修改收货人信息</label></li>'+
			'	<li class="w-1of1"><label><input type="radio" value="InvoInfo" name="ChgOrdTp" > 修改发票信息</label></li>';
		} else if (val = '2'){
			selectItem = '	<li class="w-1of1"><label><input type="radio" value="PaymentTp" name="ChgOrdTp" checked> 修改支付方式</label></li>'+
			'	<li class="w-1of1"><label><input type="radio" value="RecvInfo" name="ChgOrdTp"> 修改收货人信息</label></li>'+
			'	<li class="w-1of1"><label><input type="radio" value="InvoInfo" name="ChgOrdTp" > 修改发票信息</label></li>';
		}
		if(allowSplit=='Y'){
      		selectItem = selectItem + 
			'<li class="w-1of1"><label><input type="radio" value="AllowSplit" name="ChgOrdTp"> 修改商品缺货配送处理方法</label></li>';
		}
		
		var html='<div class="ui-dialog-content ui-widget-content" id="dialog" style="height: auto; min-height: 110px; width: auto;">'+
				'<ul>'+				
				selectItem+
				'</ul>'+
			  	'<p align="center" style="padding: 5px 0pt;" class="c-f"><a onfocus="blur()" class="btn-mid" href="javascript:;" onclick=\"goModifyOrd('+ord+');return false;\">确定</a></p>'+
				'</div>';
		openDialog('请选择您所要修改的订单内容', html, 250, 180);
	}
	function goModifyOrd(ord){
		var chgTp = $('input[name=ChgOrdTp]:checked').val();
		if(chgTp == 'RecvInfo'){
			location.href='<c-rt:url value="/member/orderMod/modAddres.do?orderId="/>'+ord;
			closeDialog();
		}else if (chgTp == 'PaymentTp'){			
			location.href='<c-rt:url value="/member/orderMod/modPay.do?orderId="/>'+ord;
			closeDialog();
		}else if (chgTp == 'InvoInfo'){			
			location.href='<c-rt:url value="/member/orderMod/modInvoice.do?orderId="/>'+ord;
			closeDialog();
		}else if(chgTp == 'AllowSplit'){
			location.href='<c-rt:url value="/member/orderMod/modAllowSplit.do?orderId="/>'+ord;
			closeDialog();
		}
		
	}	
</script>
</head>
<body>
<c-rt:set var="today" value="<%=new java.util.Date()%>" />


<fmt:formatDate value="${today}" pattern="yyyyMMddHHmm" var="now"/>

<H2>我的订单<span>（点击订单编号即可查看订单明细）</span></H2>
<p class="od-search"><input type="text" id="selectParam"  size="35" />
        <input type="submit" id="select" value="查询" /></p>

<div class="mb-show">
       <ul class="mb-tab">        
    	<li class="${(type == 'T' || type == 'Y'||type == 'S')?'mb-tab-f':''}" ><a href="${link }?t=T&p=1">近三个月订单(<b>${htmlContent.totalCount_T}</b>)</a></li>
    	<li class="${(htmlContent.orderType == 'GH'||htmlContent.orderType == 'GT'||htmlContent.orderType == 'GY')?'mb-tab-f':''}"><a href="${link }?t=GT&p=1">团购订单(<b>${htmlContent.totalCount_G}</b>)</a></li>
    	<li class="${(htmlContent.orderType == 'OP')?'mb-tab-f':''}"><a href="${link }?t=OP&p=1">抽奖活动(<b>${htmlContent.totalCount_OP}</b>)</a></li>
    	<li class="${(htmlContent.orderType=='H'|| htmlContent.orderType == 'HSP'||htmlContent.orderType =='HY'|| htmlContent.orderType =='HS')?'mb-tab-f':''}"><a href="${link }?t=H&p=1">全部订单(<b>${htmlContent.totalCount_H}</b>)</a></li>
      </ul>
      <p class="LH-1of5"></p>
      <p class="bg-yl" align="right">
      <c:choose>
	      <c:when test="${htmlContent.totalCount > 0}">
	      	共${htmlContent.totalCount} 笔 ： ${htmlContent.currentPage}/${htmlContent.totalPage}页
	      	<c:if test="${htmlContent.currentPage != 1}">   
	      		<c:if test="${htmlContent.orderType!='HSP'}">	   	
					<a href="${link }?t=${htmlContent.orderType}&p=${htmlContent.currentPage-1}">上一页</a>
				</c:if>
				<c:if test="${htmlContent.orderType=='HSP'}">
					<a href="${link }?t=${htmlContent.orderType}&p=${htmlContent.currentPage-1}&s=${htmlContent.selectparm}">上一页</a>
				</c:if>
			</c:if>
			<c:if test="${htmlContent.currentPage != htmlContent.totalPage}">		
				|<span class="txt-gy">
				<c:if test="${htmlContent.orderType!='HSP'}">	
					<a href="${link }?t=${htmlContent.orderType}&p=${htmlContent.currentPage+1}">下一页</a>
				</c:if>
				<c:if test="${htmlContent.orderType=='HSP'}">	
					<a href="${link }?t=${htmlContent.orderType}&p=${htmlContent.currentPage+1}&s=${htmlContent.selectparm}">下一页</a>
				</c:if>
				 >
				</span>
			</c:if>
	      </c:when>
	      <c:otherwise>
	     	 共${htmlContent.totalCount} 笔
	      </c:otherwise>
      </c:choose>
      </p>
      
      <c:if test="${type =='T'||type =='Y'|| type =='S'}">
      <div class="a-pick-links">
      	<a class="${type == 'T'?'filter-fc':'a-blue'}" href="${link }?t=T&p=1"">全部的</a> | 
      	<a class="${type == 'Y'?'filter-fc':'a-blue'}" href="${link }?t=Y&p=1"">需支付的订单</a>| 
      	<a class="${type == 'S'?'filter-fc':'a-blue'}" href="${link }?t=S&p=1"">被拆分的订单</a>
      </div> 
      </c:if>
      <c:if test="${type =='H'||type =='HY'|| type =='HS'||type =='HSP'}">
      <div class="a-pick-links">
      	<a class="${type == 'H'?'filter-fc':'a-blue'}" href="${link }?t=H&p=1"">全部的</a> | 
      	<a class="${type == 'HY'?'filter-fc':'a-blue'}" href="${link }?t=HY&p=1"">需支付的订单</a>| 
      	<a class="${type == 'HS'?'filter-fc':'a-blue'}" href="${link }?t=HS&p=1"">被拆分的订单</a>
      </div> 
      </c:if>
      <c:if test="${htmlContent.orderType == 'GH'||htmlContent.orderType == 'GT'||htmlContent.orderType == 'GY'}">
      <div class="a-pick-links">
      	<a class="${htmlContent.orderType == 'GT'?'filter-fc':'a-blue'}" href="${link }?t=GT&p=1"">最近团购订单</a> | 
      	<a class="${htmlContent.orderType == 'GY'?'filter-fc':'a-blue'}" href="${link }?t=GY&p=1"">需支付团购订单</a> | 
      	<a class="${htmlContent.orderType == 'GH'?'filter-fc':'a-blue'}" href="${link }?t=GH&p=1"">历史团购订单</a>
      </div> 
      </c:if>
       
      <table class="tb-2"> 
       <c:choose>
	      <c:when test="${htmlContent.orderType == 'OP'}">
	      	 <tr> <!-- 抽奖活动 -->
	          <TH width="53">编号</TH>
			  <TH width="130">活动名称</TH>
			  <TH width="60">手机号码</TH>
			  <TH width="60">所在城市</TH>
			  <TH width="40">参加日期</TH>
			  <TH width="60">活动状态</TH>
			  <TH width="60">操作</TH>
	        </tr>
	      </c:when>
	      <c:otherwise>
	     	 <tr> 
		         
		          <TH width="115">订单编号</TH>
				  <TH width="212">订单商品</TH>
				  <TH width="80">金额</TH>
				  <TH width="75">支付方式</TH>
				  <TH width="50">订购日</TH>
				  <TH>状态</TH>
				  <TH width="78">操作/备注</TH>
		      
		      </tr>
	      </c:otherwise>
      </c:choose>
        <c-rt:set var="pcounter" value="1" />
  <c:choose>
	      <c:when test="${htmlContent.orderType == 'OP'}">     
			      <c:if test="${htmlContent.totalCount > 0}">	
				       	<c:forEach items="${htmlContent.orderPrizes}" var="orderPrizes" varStatus="oi">
					       	<tr>
					       	<td>${orderPrizes.prizeId}</td>
					       	<td>${orderPrizes.promoteName}</td>
				       		<td>${orderPrizes.prizeMobile}</td>
			      			<td>${orderPrizes.prizePlace}</td>
			   				<td><fmt:formatDate value="${orderPrizes.orderDate}" pattern="yyyy'<br>'MM/dd HH:mm" /></td>
							<td>${orderPrizes.orderSt == '01'? '已结束' : '进行中'}</td>
							<td><a href=>查看</a></td>
					       	</tr>
			      		 </c:forEach>
		      		 </c:if>
		      		 <c:if test="${htmlContent.totalCount == 0}">
		      		 		<tr><td height="30" colspan="7">您没有任何订单</td>	</tr>
		      		 </c:if>
		   </c:when>
	      <c:otherwise>
					        <c:choose>
						        <c:when test="${htmlContent.totalCount > 0}">
							        <c:forEach items="${htmlContent.orders}" var="order" varStatus="oi">
										<%--判斷訂單修改 --%>
										<c-rt:set var="canChgPaymentIfo" value="N"/>
							         	<c-rt:set var="canChgRecvInfo" value="N"/>
							         	<c:choose>
								          <c:when test="${order.paymentTp=='30' or order.paymentTp=='60'}">
								          	<c:if test="${order.orderSt=='00'}">
												<c-rt:set var="canChgPaymentIfo" value="Y"/>
							         			<c-rt:set var="canChgRecvInfo" value="Y"/>
											</c:if>
											<c:if test="${order.orderSt=='20' }">
												<c-rt:set var="canChgRecvInfo" value="Y"/>
											</c:if>
								          </c:when>
								          <c:when test="${order.paymentTp=='50'||order.paymentTp=='70'}">			          
								          	<c:if test="${order.paymentSt=='00' && order.orderSt == '10'}">
												<c-rt:set var="canChgPaymentIfo" value="Y"/>
							         			<c-rt:set var="canChgRecvInfo" value="Y"/>
											</c:if>
											<c:if test="${order.paymentSt=='10' && !order.sync && order.orderSt == '20'}">
												<c-rt:set var="canChgRecvInfo" value="Y"/>
											</c:if>	
								          </c:when>			          
								          <c:otherwise>
								          	<c:if test="${order.paymentSt=='00' && order.orderSt == '10'}">							
							         			<c-rt:set var="canChgRecvInfo" value="Y"/>
											</c:if>
											<c:if test="${order.paymentSt=='10' && !order.sync && order.orderSt == '20'}">
												<c-rt:set var="canChgRecvInfo" value="Y"/>
											</c:if>			          
								          </c:otherwise> 
								        </c:choose>
								        
								         <tr<c-rt:if test="${(order.splitType == 2 && type!='HSP')||(htmlContent.ordersize>1 && order.splitType == 2 && type=='HSP')}"> style="display:none" id="split_${order.orgOrderId}" class="od-separate-sub"</c-rt:if><c-rt:if test="${order.orderSt=='83'}"> id="org_${order.orderId}"</c-rt:if>> 
								         
								          <!-- 订单号 -->
								          <td class="west">								          	
								          	<div class="od-num ${not empty order.tuangouId?'icon-tuangou':'' }">
								          	<c-rt:if test="${not empty order.tuangouId}">
								          	 <c-rt:set var="prodhref" value="${htmlContent.frontContextPath}/tuangou/product.do?tuangouId=${order.tuangouId}"/>			          	 	
								          	 <span class="icon-tuangou"><a href="${prodhref}" target="_blank" title="${order.tuangouName }"><img src="/images/none.gif" /></a></span>
								          	 </c-rt:if>
								          	<a href="${htmlContent.frontContextPath}/member/order/page.do?page=detail&orderId=${order.orderId}" target="_blank">${order.orderId }</a>
								          	</div>
								          </td> 
								          
								          <!-- 商品图片-->	
								          <c-rt:if test="${order.orderSt=='83'}"><td style="display:none" id="org_empty_op_${order.orderId}"></td></c-rt:if>
								          <td<c-rt:if test="${order.orderSt=='83'}"> id="org_op_${order.orderId}"</c-rt:if>><p>
								          	<c:forEach items="${order.orderProduct}" var="product" begin="0" end="${fn:length(order.orderProduct)>3 ? '2' : fn:length(order.orderProduct)}" varStatus="pi">
								          		<c-rt:set var="prodNm" value="${product.prodName}-${product.prodSpecName}" />
									  				<a class="pd-img" href="<c:choose><c:when test="${not empty order.tuangouId}">${prodhref}</c:when><c:otherwise>${frontendContextPath}/product/product.do?productId=${product.prodId}&hpp=history</c:otherwise></c:choose>" target="_blank"><img width="50" height="50" alt="" src="${imgDomain}/PImg/${pu:substring(product.prodId, 0,4) }/${product.prodId}/${product.prodId}_m50.jpg" onError="this.src='/PImg/blank_50.gif'" title="${product.prodName}-${product.prodSpecName}"></a>
				        					</c:forEach>
					                           <c-rt:if test="${fn:length(order.orderProduct)>3}"><a href="/ecmall/member/order/page.do?page=detail&orderId=${order.orderId}"><span class="pd-more">...更多</span></a></c-rt:if>
								          </p></td>
								          
								          <!-- 订单金额 -->
								          <fmt:formatNumber pattern="######0.0" var="totalPrice" value="${order.totalPrice - order.bonus - order.coupon + order.shipfare - order.discount + order.codFee + order.installmentFee}"></fmt:formatNumber>
								          <td>￥${totalPrice}</td> 
							         	
							         	  <td>	<!-- 支付方式 -->		          
									          <c:choose>
									          <c:when test="${order.paymentTp=='30' or order.paymentTp=='60'}">货到付款</c:when>
									          <c:otherwise>${paymentTpMenu.options[order.paymentTp].name}</c:otherwise> 
									          </c:choose>
								          </td> 
								          
								          <td><!-- 订购日 -->			
								          	<fmt:formatDate value="${order.orderDt}" pattern="yyyy'<br>'MM/dd" />
								          </td>
								          
								          <td><!-- 订单状态 -->
									          <c:choose>
									          <c:when test="${order.orderSt=='32'&&order.receiverTp=='30'}">已送达门店</c:when>
									          <c:when test="${order.orderSt=='35'&&order.receiverTp=='30'}">已取货</c:when>
									          <c:when test="${order.orderSt=='30'}">${orderStMenu.options[order.orderSt].name}<br></c:when>
									          <c:when test="${order.orderSt=='83'}">原始订单<br />&nbsp;(已拆分)</c:when>
									          <c:otherwise>${orderStMenu.options[order.orderSt].name}</c:otherwise> 
									          </c:choose>		          
								          </td> 
								          
								          <td><!-- 操作／备注 -->
								          	<%--订单状态为等待付款且付款期限内,可以使用网上支付，取當天2359 --%>			          	
								          	<fmt:formatDate value="${order.deadline}" pattern="yyyyMMdd2359" var="paydeadline"/>
								          	<c:if test="${order.orderSt == '10' && now < paydeadline && (order.paymentTp == '50'|| order.paymentTp == '70'|| order.paymentTp == '80')}">			          		
								          		<a class="od-do-note a-red" href="${htmlContent.frontContextPath}/shopping/paymentInfo/paymentInfoView.do?orderId=${order.orderId}"><span>网上支付</span></a>
								          	</c:if>
								          		<%--订单状态为等待配货(含)前的情形下可以取消 --%>
								          	<c:if test="${order.orderSt == '00' || order.orderSt == '10' || order.orderSt == '20'}">
								          		<a class="od-do-note" onclick="doAR('${htmlContent.frontContextPath}/member/serviceOrder/toCancelOrder.do?orderId=${order.orderId}', 'cancelDialog');openDialogById('取消订单',null,450,310,'cancelDialog');" href="javascript:;"><span>取消订单</span></a>
								          	</c:if>
								          	<c-rt:set var="allowSplit" value="N"/>
											<c-rt:if test="${fn:length(order.orderProduct)>1 && order.paymentTp != '30' && order.paymentTp != '60' && order.receiverTp != '30'}">
												<c-rt:set var="allowSplit" value="Y"/>	
											</c-rt:if>
								          	<c:if test="${canChgPaymentIfo== 'N' && canChgRecvInfo== 'Y'}">
								          		<a  href="javascript:;" class="od-do-note" onclick="openChgOrder('1','${order.orderId}','${allowSplit}');return false;" ><span>修改订单</span></a>
								          	</c:if>
								          	<c:if test="${canChgPaymentIfo== 'Y' && canChgRecvInfo== 'Y'}">
								          		<a  href="javascript:;" class="od-do-note" onclick="openChgOrder('2','${order.orderId}','${allowSplit}');return false;" ><span>修改订单</span></a>
								          	</c:if>
								          	<c-rt:if test="${order.orderSt == '30' }">
								          		<a class="od-do-note" href="${htmlContent.frontContextPath}/member/order/page.do?page=detail&orderId=${order.orderId}"><span>物流跟踪</span></a> 
								          	</c-rt:if>
								          	
								          	<c-rt:if test="${order.orderSt == '83' }"> 
								          		${pu:reqSet('orgOrderId',null)}
								          		${pu:reqSet('sopHql', 'from Orders where orgOrderId =? ')}
												${pu:listAdd('orgOrderId', pu:toString(order.orderId))}							
												${pu:reqSet('splitOrderList', pu:queryByHql(sopHql,  pu:arrayGet('orgOrderId'), null))}
												<div class="od-more-dtl" onmouseover="$('#share-Split_${order.orderId}_${pcounter}').show();" onmouseout="$('#share-Split_${order.orderId}_${pcounter}').hide();">
								          			<div id="share-Split_${order.orderId}_${pcounter}" class="show-more-dtl" style="display:none">
								          			 <b>&nbsp;</b>
								          			<h6>拆分订单</h6>
								          			<p>该订单被拆分成以下订单：</p>
										                <table class="tb-2">
										                  <tr>
										                    <th width="110">订单编号</th>
										                    <th>订购商品</th>
										                  </tr>
									          	     	<c-rt:if test="${splitOrderList !=null}">
								          	     		  <c-rt:forEach items="${splitOrderList}" var="splitOrderList" varStatus="status">
								          	     		  <tr>
								          	     		  	<td>
								          	     		  		<a href="${htmlContent.frontContextPath}/member/order/page.do?page=detail&orderId=${splitOrderList.orderId}">${splitOrderList.orderId}</a>
															</td>
															<td><p>					
																<c-rt:forEach items="${splitOrderList.orderProduct}" var="product" begin="0" end="${fn:length(splitOrderList.orderProduct)>3 ? '2' : fn:length(splitOrderList.orderProduct)}" varStatus="pi">						
																	<a class="pd-img" href="${frontendContextPath}/product/product.do?productId=${product.prodId}&hpp=history" target="_blank"><img width="50" height="50" alt="" src="${imgDomain}/PImg/${pu:substring(product.prodId, 0,4) }/${product.prodId}/${product.prodId}_m50.jpg" onError="this.src='/PImg/blank_50.gif'" title="${product.prodName}-${product.prodSpecName}"></a>
										        				</c-rt:forEach>
										        				<c-rt:if test="${fn:length(splitOrderList.orderProduct)>3}"><a href="${htmlContent.frontContextPath}/member/order/page.do?page=detail&orderId=${splitOrderList.orderId}"><span class="pd-more">...更多</span></a></c-rt:if>
															</p></td>
															</tr>	
								          	     		  </c-rt:forEach>
								          	     		  </c-rt:if>
								          	     	</table>
								          	     	<p>若有疑问可致电4001-168-100询问客服</p>
													</div>
								          		 <a href="javascript:;" title="展开" id="open_${order.orderId}"><img alt="展开" src="/images/mb/icon_open.gif" ></a>
								          		</div>
								          		<a title="收合" href="javascript:;" id="close_${order.orderId}" style="display:none"><img alt="收合" src="/images/mb/icon_close.gif"></a>
								          	  </c-rt:if>

								          	<c-rt:if test="${order.orderSt=='80'}">
									          	${pu:reqSet('orderFKParams',null)}
									            ${pu:reqSet('hqlMFK', 'from Orders where orgOrderId=?') }
									    		${pu:listAdd('orderFKParams', order.orderId) }
									    		${pu:reqSet('theOrdersFK', pu:queryByHql(hqlMFK, pu:arrayGet('orderFKParams'), null)) }
									    		<c-rt:if test="${fn:length(theOrdersFK)>0}">
	    										<div class="od-more-dtl" onmouseover="$('#share-fk1_${order.orderId}_${pcounter}').show();" onmouseout="$('#share-fk1_${order.orderId}_${pcounter}').hide();">
	    											<div id="share-fk1_${order.orderId}_${pcounter}" class="show-more-dtl"  style="display:none">
									          			  <b>&nbsp;</b>
									          			 <h6>部分取消订单</h6>
											              <p>因订单中部分商品断缺货或被取消，系统生成以下新订单为您配送有货商品：</p>
											              <table class="tb-2">
											                <tr>
											                  <th width="110">订单编号</th>
											                  <th>订购商品</th>
											                </tr>
								          	     		  
								          	     		  <tr>
								          	     		  	<td>
								          	     		  		<a href="${htmlContent.frontContextPath}/member/order/page.do?page=detail&orderId=${theOrdersFK[0].orderId}">${theOrdersFK[0].orderId}</a>
															</td>
															<td><p>				
																<c-rt:forEach items="${theOrdersFK[0].orderProduct}" var="product" begin="0" end="${fn:length(theOrdersFK[0].orderProduct)>3 ? '2' : fn:length(theOrdersFK[0].orderProduct)}" varStatus="pi">						
																	<a class="pd-img" href="${frontendContextPath}/product/product.do?productId=${product.prodId}&hpp=history" target="_blank"><img width="50" height="50" alt="" src="${imgDomain}/PImg/${pu:substring(product.prodId, 0,4) }/${product.prodId}/${product.prodId}_m50.jpg" onError="this.src='/PImg/blank_50.gif'" title="${product.prodName}-${product.prodSpecName}"></a>
										        				</c-rt:forEach>
										        				<c-rt:if test="${fn:length(theOrdersFK[0].orderProduct)>3}"><a href="${htmlContent.frontContextPath}/member/order/page.do?page=detail&orderId=${theOrdersFK[0].orderId}"><span class="pd-more">...更多</span></a></c-rt:if>
															</p></td>
															</tr>	
								          	     		  
								          	     	</table>
								          	     	<p>若有疑问可致电4001-168-100询问客服</p>
									            </div>
									            <span>部分取消单</span></div>
									            </c-rt:if>
								          </c-rt:if>

								        	<c-rt:if test="${order.orderId ne order.joinOrders}"> 
									         	 ${pu:reqSet('joinOrdersId',null)}
								          	    ${pu:reqSet('sopHql', 'from Orders where joinOrders=?')}
												${pu:listAdd('joinOrdersId', pu:toString(order.joinOrders))}							
												${pu:reqSet('joinOrderList', pu:queryByHql(sopHql, pu:arrayGet('joinOrdersId'), null))}
												<div class="od-more-dtl" onmouseover="$('#share-join_${order.orderId}_${pcounter}').show();" onmouseout="$('#share-join_${order.orderId}_${pcounter}').hide();">
								          	     <div id="share-join_${order.orderId}_${pcounter}"  class="show-more-dtl" style="display:none;">
								          	     	<b>&nbsp;</b>
								          	     	<h6>关联订单</h6>
									                    <p>您结帐时生成以下订单，他们需要一起支付，若修改支付方式或取消其中一单时，另一单将会被一起处理：</p>
									                    <table class="tb-2">
									                        <tr>
									                          <th width="110">订单编号</th>
									                          <th width="215">订购商品</th>
									                          </tr>
								          	     		   <c-rt:if test="${joinOrderList !=null}">
								          	     		  <c-rt:forEach items="${joinOrderList}" var="joinOrderList" varStatus="status">
								          	     		  <tr>
								          	     		  	<td>
								          	     		  		<a  href="${htmlContent.frontContextPath}/member/order/page.do?page=detail&orderId=${joinOrderList.orderId}">${joinOrderList.orderId}</a>
															</td>
															<td><p>					
																<c-rt:forEach items="${joinOrderList.orderProduct}" var="product" begin="0" end="${fn:length(joinOrderList.orderProduct)>3 ? '2' : fn:length(joinOrderList.orderProduct)}" varStatus="pi">						
																	<a class="pd-img" href="${frontendContextPath}/product/product.do?productId=${product.prodId}&hpp=history" target="_blank"><img width="50" height="50" alt="" src="${imgDomain}/PImg/${pu:substring(product.prodId, 0,4) }/${product.prodId}/${product.prodId}_m50.jpg" onError="this.src='/PImg/blank_50.gif'" title="${product.prodName}-${product.prodSpecName}"></a>
										        				</c-rt:forEach>
										        				<c-rt:if test="${fn:length(joinOrderList.orderProduct)>3}"><a href="${htmlContent.frontContextPath}/member/order/page.do?page=detail&orderId=${joinOrderList.orderId}"><span class="pd-more">...更多</span></a></c-rt:if>
															</p></td>
															</tr>	
								          	     		 	</c-rt:forEach>
								          	     		  </c-rt:if>  
								          	     	</table>
								          	     	 <p>若有疑问可致电4001-168-100询问客服</p>
									                </div>
									                <span>关联订单</span>
								          	    </div>
											</c-rt:if>
											<c-rt:if test="${order.orgOrderId!=null}">
											${pu:reqSet('orderFKParams',null)}
								            ${pu:reqSet('hqlMFK', 'from Orders where orderId=?') }
								    		${pu:listAdd('orderFKParams', order.orgOrderId) }
								    		${pu:reqSet('theOrdersFK', pu:queryByHql(hqlMFK, pu:arrayGet('orderFKParams'), null)) }
								    		 <c-rt:if test="${theOrdersFK !=null && theOrdersFK[0].orderSt=='80'}">
	    										<div class="od-more-dtl" onmouseover="$('#share-fk2_${order.orderId}_${pcounter}').show();" onmouseout="$('#share-fk2_${order.orderId}_${pcounter}').hide();">
	    											<div id="share-fk2_${order.orderId}_${pcounter}" class="show-more-dtl" style="display:none">
									          			 <b>&nbsp;</b>
									          			<h6>系统生成单</h6>
											              <p>因以下原订单中部分商品断缺货：</p>
											              <table class="tb-2">
											                <tr>
											                  <th width="110">订单编号</th>
											                  <th>订购商品</th>
											                </tr><tr>
								          	     		  	<td>
								          	     		  		<a href="${htmlContent.frontContextPath}/member/order/page.do?page=detail&orderId=${theOrdersFK[0].orderId}">${theOrdersFK[0].orderId}</a>
															</td>
															<td><p>				
																<c-rt:forEach items="${theOrdersFK[0].orderProduct}" var="product" begin="0" end="${fn:length(theOrdersFK[0].orderProduct)>3 ? '2' : fn:length(theOrdersFK[0].orderProduct)}" varStatus="pi">						
																	<a class="pd-img" href="${frontendContextPath}/product/product.do?productId=${product.prodId}&hpp=history" target="_blank"><img width="50" height="50" alt="" src="${imgDomain}/PImg/${pu:substring(product.prodId, 0,4) }/${product.prodId}/${product.prodId}_m50.jpg" onError="this.src='/PImg/blank_50.gif'" title="${product.prodName}-${product.prodSpecName}"></a>
										        				</c-rt:forEach>
										        				<c-rt:if test="${fn:length(theOrdersFK[0].orderProduct)>3}"><a href="${htmlContent.frontContextPath}/member/order/page.do?page=detail&orderId=${theOrdersFK[0].orderId}"><span class="pd-more">...更多</span></a></c-rt:if>
															</p></td>	
								          	     	 </tr>
								          	     	</table>
								          	     	<p>若有疑问可致电4001-168-100询问客服</p>
										            </div>
										            <span>系统生成单</span> 
										          </div>
										       </c-rt:if>
								          </c-rt:if> 
								          </td>
									</c:forEach>
						        </c:when>
						        <c:otherwise>
							        <c:if test="${type == 'Y'||type == 'HY'}">
							        	<td height="30" colspan="11">您没有需支付的订单！</td>
							        </c:if>						        	
							        <c:if test="${type == 'S'||type == 'HS'}">
							        	<td height="30" colspan="11">您没有被拆分的订单！</td>
							        </c:if>
							        <c:if test="${type =='T'}">
							        	<td height="30" colspan="11">您最近三个月都没有下过订单，赶快去挑选商品吧！</td>
							        </c:if>
							        <c:if test="${type =='H'}">
							        	<td height="30" colspan="11">您都没有下过订单，赶快去挑选商品吧！</td>
							        </c:if>
							        <c:if test="${type == 'HSP'}">
							        	<c:if test="${!empty htmlContent.errorMsg }">
							        		<td height="30" colspan="11">${htmlContent.errorMsg}</td>
							        	</c:if>
							        	<c:if test="${empty htmlContent.errorMsg }">
							        		<td height="30" colspan="11">查无资料，请重新输入！</td>
							        	</c:if>
							        </c:if>       
						        </c:otherwise>
					        </c:choose>
  		 </c:otherwise>
		</c:choose>
        </table> 
	<c:if test="${htmlContent.totalCount > 0}">
	      <p class="page-change">
			<c:choose>
	         <c:when test="${htmlContent.totalPage==1 || htmlContent.currentPage==1}">
				<span class="a-no">&lt; 上一页</span> |
			 </c:when>
			<c:otherwise>
				<c:if test="${htmlContent.orderType!='HSP'}">	
					<a href="${link }?t=${htmlContent.orderType}&p=${htmlContent.currentPage-1}" class="a-togo">&lt; 上一页</a> |
				</c:if>
				<c:if test="${htmlContent.orderType=='HSP'}">
					<a href="${link }?t=${htmlContent.orderType}&p=${htmlContent.currentPage-1}&s=${htmlContent.selectparm}" class="a-togo">&lt; 上一页</a> |
				</c:if>
			</c:otherwise>
			</c:choose>		
			<c:forEach begin="${htmlContent.startPage}" end="${htmlContent.endPage}" var="i">
				<c:choose>
					<c:when test="${htmlContent.currentPage==i}">
						<b class="pg-now">${i}</b>
					</c:when>
					<c:otherwise>
						<c:if test="${htmlContent.orderType!='HSP'}">	
							<a href="${link}?t=${htmlContent.orderType}&p=${i}">${i}</a>
						</c:if>
						<c:if test="${htmlContent.orderType=='HSP'}">
							<a href="${link}?t=${htmlContent.orderType}&p=${i}&s=${htmlContent.selectparm}">${i}</a>
						</c:if>
					</c:otherwise>
				</c:choose>
			</c:forEach>
			<c:choose>
			<c:when test="${htmlContent.currentPage == htmlContent.totalPage}">
				<span class="a-no"> | 下一页 &gt;</span>
			</c:when>
			<c:otherwise>
				<c:if test="${htmlContent.orderType!='HSP'}">	
				 | <a href="${link }?t=${htmlContent.orderType}&p=${htmlContent.currentPage+1}" class="a-togo">下一页 &gt;</a>
				</c:if>
				<c:if test="${htmlContent.orderType=='HSP'}">
				 | <a href="${link }?t=${htmlContent.orderType}&p=${htmlContent.currentPage+1}&s=${htmlContent.selectparm}" class="a-togo">下一页 &gt;</a>
				</c:if>
			</c:otherwise>
			</c:choose>
		 </p>
	</c:if>
</div> 
<div id="dialog" style="display:none"></div>
<div id="cancelDialog" style="display:none" class="od-cancel-dailog"></div>
</body>
</html>